coroutine and generator
Generators provide less power than coroutines, because only the top-most frame in the coroutine is allowed to yield. That frame is moved back and forth between an object and the call stack to suspend and resume it.
Iterators were inspired by a construct in Alphard called a "generator".
A CLU iterator is a single operation that yields its results incrementally. For example,
elements = iter (s: set[t]) yields (t)
produces all the elements in set s, but it yields them one at a time. An iterator is called in a for statement:
for x: int in set[int]$elements(coll) do